<template>
  <div class="map">
    <!-- <baidu-map
      id="container"
      :center="center"
      :zoom="zoom"
      @ready="handler"
    >
    </baidu-map> -->

    <baidu-map
      id="container"
      :center="center"
      :zoom="zoom"
    >
      <bm-geolocation
        anchor="BMAP_ANCHOR_BOTTOM_RIGHT"
        :showAddressBar="true"
        :autoLocation="true"
      ></bm-geolocation>
    </baidu-map>
  </div>
</template>
<script>
export default {
  data() {
    return {
      // center: { lng: 0, lat: 0 },
      center: '长沙市',
      zoom: 18
    }
  },
  mounted() {},
  methods: {
    handler({ BMap, map }) {
      console.log(BMap, map)
      // this.center.lng = 116.404
      // this.center.lat = 39.915
      // this.zoom = 15
    }
  }
}
</script>
<style lang="scss" scoped>
.map,
#container {
  height: 100%;
}
</style>
